#ifndef AMENTITYMANAGER_H
#define AMENTITYMANAGER_H

#include <QObject>
#include <QHash>
#include "base/amentity.h"
#include "base/meshdata.h"

/**
  * Responsible for creating, storing and purging all
  * AMEntities
  *
  */
class AMEntityManager : public QObject
{
    Q_OBJECT
public:
    static AMEntityManager * get();
    AMVirtualEntity * fetch(const QString & entityName);
signals:
    void entityCreated(const QString & entityName);
    void entityPurged(const QString & entityName);
public slots:
    void create(const QString & entityName, MeshData * meshData);
    void purge(const QString & entityName);
private:
    explicit AMEntityManager(QObject *parent = 0);
    QHash<QString, AMVirtualEntity *> m_Entities;
};

#endif // AMENTITYMANAGER_H
